<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .num1 {
        background: url(../day13/图片/1.jpg);
        background-size: 100vw 100vh;
      }
      .num2 {
        background: url(../day13/图片/2.jpg);
        background-size: 100vw 100vh;
      }
      .num3 {
        background: url(../day13/图片/3.jpg);
        background-size: 100vw 100vh;
      }
      .num4 {
        background: url(../day13/图片/4.jpg);
        background-size: 100vw 100vh;
      }
      .num5 {
        background: url(../day13/图片/5.jpg);
        background-size: 100vw 100vh;
      }
      .num6 {
        background: url(../day13/图片/6.jpg);
        background-size: 100vw 100vh;
      }
      .num7 {
        background: url(../day13/图片/7.jpg);
        background-size: 100vw 100vh;
      }
    </style>
  </head>
  <body>
    <button>点击更换</button>
    <script>
      var butEle = document.querySelector("button");
      function fn(max, min) {
        return parseInt(Math.random() * (max + 1 - min) + min);
      }

      butEle.onclick = function () {
        document.body.className = `num${fn(7, 1)}`;
      };
    </script>
  </body>
</html>
